package com.ems.mapper;

import com.ems.entity.TMenu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ems.entity.TUser;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ZZH
 * @since 2022-06-27
 */
@Mapper
public interface TMenuMapper extends BaseMapper<TMenu> {
    //增加数据
//    @Insert("insert into t_menu(id,menu_name,remarks,del_flag,creator,updater) values (#{id},#{menuName},#{remarks},#{delFlag},#{creator},#{updater})")
    public Boolean add1(TMenu tMenu);

    public Boolean add2(@Param("menuId") Integer x);

    //删除数据
//    @Delete("delete from t_menu where id = #{id}")
    public Boolean delete(Integer id);

    public Boolean delete2(Integer id);

    //修改数据
//    @Update("update t_menu set menu_name = #{menuName}, remarks = #{remarks}, del_flag = #{delFlag}, creator = #{creator}, updater = #{updater} where id = #{id}")
    public Boolean update(TMenu tMenu);

    //查找数据(单)
//    @Select("select * from t_menu where id = #{id}")
    public TMenu findOne(Integer id);

    //查找数据(全)
//    @Select("select * from t_menu")
    List<TMenu> findAll();

    int findUserRole(String userName);

    List<TMenu> findMenuId(int pid);
}
